package com.ayu.scalalearn.chapter06

import scala.beans.BeanProperty

/**
  * @Author 徐林玉
  * @Description Test01Class
  * @Date 2022/7/28 11:28
  * @Version 1.0
  */
object Test01Class {

  def main(args: Array[String]): Unit = {

    var stu =  new Student()
    println(stu.name)
    println(stu.age)
    println(stu.sex)


  }

}

class Student {

  //beanproperty提供对应字段的get、set方法，为了兼容java
  @BeanProperty
  var name: String = "alice"

  var age: Int = _

  var sex: String = _

}
